package com.ljm.controller;

import com.ljm.domian.CommonResult;
import com.ljm.domian.Order;
import com.ljm.service.OrderService;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author PengHuAnZhi
 * @createTime 2021/2/25 17:08
 * @projectName SpringCloudDemo
 * @className OrderController.java
 * @description TODO
 */
@RestController
public class OrderController {
    @Resource
    private OrderService orderService;


    /**
     * 创建订单
     *
     * @param order
     * @return
     */

    @GetMapping("/order/create")
    public CommonResult create(Order order) {
        orderService.create(order);
        return new CommonResult(200, "订单创建成功");
    }
}
